enum GameOverControlEvent {
    GameIsOver = 1,
}

class GameOverControl extends core.BaseController {

    private _view: ui.GameOver
    constructor() {
        super()
        this._view = new ui.GameOver(this, LayerManager.UI_Game)

        this.registerFunc(ui.GameOverEvent.TryAgainBtn, this.onTryAgain, this)
        this.registerFunc(GameOverControlEvent.GameIsOver, this.showGameOver, this)
    }

    private onTryAgain(): void {
        core.App.SceneManager.runScene(SceneConsts.Tarzan)
    }

    private showGameOver(score: number): void {
        core.App.ViewManager.open(ui.ViewConst.GameOver)
        this._view.SetScoreLText(score.toString())
    }
    
}